<form action="index.php?app=ome&ctl=admin_goods_sku&act=save"
	method="post" id='sku_form'>
	<h5 class="head-title"><{t}>编辑商品SKU<{/t}></h5>
 
  <input type="hidden" name="sku[map_id]" value=<{$sku.map_id}>>
	<div class="tableform tableform-tabs">
		<{tabber}>
		<div class="division"
			style="padding: 5px; border: 1px solid #dddddd; margin: 1px 0px;">
			<{tab name="基本设置"}>  

			<div class="division" style="padding: 3px; margin: 0;">
				<table>
					<tr>
						<th align="right"><{t}>货号:<{/t}></th>
						<td><input type="text" class="_x_ipt" vtype="required"
							name="sku[bn]" value="<{$sku.bn|escape:html}>">*</td>
					</tr>
					<tr>
						<th align="right"><{t}>SKU:<{/t}></th>
						<td><input type="sku[text]"
							value="<{$sku.sku|escape:html}>" name="sku[sku]" /> </td>
					</tr>
<tr>
						<th align="right"><{t}>来源店铺:<{/t}></th>
						<td>
							<select name="sku[shop_id]">
                <option value=""> </option>
                <{foreach from=$shopData item=shop}>
                    <option value="<{$shop.shop_id}>*<{$shop.node_id}>"  <{if $shop.shop_id==$sku.shop_id }>selected<{/if}>  ><{$shop.name}></option>
                <{/foreach}>
            </select>
							</td>
					</tr>
				
				</table>
			</div>

			<{/tab}>


		</div>
		<{/tabber}>
	</div>

	<div class="table-action"><{button type="button" label="保存"
		id='sku_submit'}></div>
</form>
<script>
	(function() {
		$('sku_form').store('target',{
		    onRequest:function(){
		       $('sku_submit').set('disabled', 'true');
		    },
		    onComplete:function(jsontext){
		       var json = Json.evaluate(jsontext);
		       if (typeof(json.error) != 'undefined'){
		           $('sku_submit').set('disabled', '');
		       }else{
		           $('sku_submit').set('disabled', 'true');
		           opener.finderGroup['<{$env.get.finder_id}>'].refresh.delay(400,opener.finderGroup['<{$env.get.finder_id}>']);
		           window.close();
		       }
		    }
		    });

		$('sku_submit')
				.addEvent(
						'click',
						function() {
							//类型名称不能为空
							var bn = $E('#sku_form input[name^=sku[bn]').get('value');
							var sku = $E('#sku_form input[name^=sku[sku]').get('value');
							 var shop = $E('#sku_form select[name^=sku[shop_id]').get('value');
							if (!bn) {
								alert('货号不能为空！');
								return false;
							}
							if (!sku) {
								alert('SKU不能为空！');
								return false;
							}
							if (!shop) {
								alert('来源店铺不能为空！');
								return false;
							}
							$('sku_form').fireEvent(
									'submit', {
										stop : $empty
									});
						});
	})();
</script>
